﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GroupStudyTimeSet.aspx.cs" EnableEventValidation = "false"  Inherits="Manage_basisset_GroupStudyTimeSet" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../skin/css/base.css" />
    <script language="javascript" type="text/javascript" src="../../Scripts/mootools.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/calendar.js"></script>
    <script src="../../Scripts/calendar/Popup.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
     
        function checkForm() {
            var startdate = document.getElementById("txtstartdate");
            var enddate = document.getElementById("txtenddate");
            if (startdate.value.length == 0) {
                alert("开始日期不能为空！");
                startdate.focus();
                return false;
            }
            if (enddate.value.length == 0) {
                alert("结束日期不能为空！");
                enddate.focus();
                return false;
            }
        }
      
</script>
    <style type="text/css">
        .style1
        {
            width: 130px;
        }
        .style2
        {
            width: 242px;
        }
        .style3
        {
            width: 47px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"  EnableScriptGlobalization="True" EnableScriptLocalization="True">
        </asp:ScriptManager>
         <asp:UpdatePanel ID="up1" runat="server" >
    <ContentTemplate>
     
     
       <!--  提交 -->
     <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
   
    <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td height="24"  background="../skin/images/tbg.gif">&nbsp;安排上课课程列表 &nbsp;&nbsp;<asp:Button ID="btnexport" runat="server"     Text="导出Excel" onclick="btnexport_Click" /></td>               
    </tr>
    
    <tr style="background-color:#ffffff">
    <td >
         <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" BorderColor="#D1DDAA"  
                            AutoGenerateColumns="False"   OnRowCancelingEdit="GridView1_RowCancelingEdit"
                            OnRowEditing="GridView1_RowEditing" 
              OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting"
                            DataKeyNames="GroupClassId"  SelectedIndex="0" 
              OnRowDataBound="GridView1_RowDataBound" GridLines="Both" 
              AllowPaging="False" PageIndex="1" AllowSorting="true" 
              onsorting="GridView1_Sorting" >
                            <Columns>
                             <asp:TemplateField HeaderText="选择" >
                                    <ItemTemplate>
                                          <asp:CheckBox ID="chkID1" runat="server" />
                                          <asp:HiddenField ID="hdfGroupClassId" runat="server" Value='<%#Eval("GroupClassId") %>' />
                                    </ItemTemplate>
                                    
                                    <ItemStyle width="40px" HorizontalAlign="Center"  />
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="课程编号" SortExpression="ClassCode">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCode" runat="server" Text='<%# Eval("ClassCode") %>'></asp:Label>
                                        <asp:HiddenField ID="hdfClassId" runat="server" Value='<%#Eval("ClassId") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="课程类型" SortExpression="ClassTypeName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTypename" runat="server" Text='<%# Eval("ClassTypeName") %>'></asp:Label>   
                                    </ItemTemplate>
                                </asp:TemplateField>
                               
                                <asp:TemplateField HeaderText="课程名称" SortExpression="ClassName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblname" runat="server" Text='<%# Eval("ClassName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="课程小时数" SortExpression="Time">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTime" runat="server" Text='<%# Eval("Time") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                               
                                 <asp:TemplateField HeaderText="开始日期" SortExpression="StartDate">
                                    <ItemTemplate>
                                        <asp:Label ID="lblstartdate" runat="server" Text='<%#Eval("StartDate") %>'></asp:Label>
                                       
                                    </ItemTemplate>
                                     <EditItemTemplate>
                                        <asp:TextBox ID="txtStartDate"  onclick="fPopUpCalendarDialg(this);return false"  Text='<%#Eval("StartDate") %>'  runat="server" Width="140px" />
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="结束日期" SortExpression="EndDate">
                                    <ItemTemplate>
                                        <asp:Label ID="lblenddate" runat="server" Text='<%#Eval("EndDate") %>'></asp:Label>
                                       
                                    </ItemTemplate>
                                     <EditItemTemplate>
                                        <asp:TextBox ID="txtEndDate" onclick="fPopUpCalendarDialg(this);return false"  Text='<%#Eval("EndDate") %>'  runat="server" Width="140px" />
                                       
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField   HeaderText="操作" ItemStyle-HorizontalAlign="Center" />
                            </Columns>
                            <PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
                            <RowStyle Height="20px" BackColor="#FFFFFF"  ForeColor="#000000" />
                            <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#FCFDEE" />
                            <SelectedRowStyle BackColor="#FFFFFF"  ForeColor="#000000" />
                            <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#FCFDEE"  ForeColor="000000" />
                            <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                            
                        </asp:GridView>
      </td>
   </tr>
     <tr bgcolor="#FAFAF1">
    <td height="28"  style=" padding-left:14px">
	    <asp:CheckBox ID="selectAll1" runat="server" Enabled="false"  Text="全选" 
            oncheckedchanged="selectAll1_CheckedChanged" AutoPostBack="true" />&nbsp;
          <asp:Button class="coolbg" ID="Button1" Enabled="false" OnClientClick="return confirm('你确定要删除选择课程吗?');" runat="server"
                          Text="批量删除"  OnClick="btnDeleteMass_Click"/>
    </td>
    </tr>
    </table>
   
    <table width="98%" border="0" cellpadding="2" cellspacing="1"  align="center" style="margin-top:8px">
   
    <tr  style="border-bottom:none">
	    <td height="24" style=" text-align:left"> 
           <asp:Label ID="lbladdclass" runat="server" ForeColor="Red" Text="添加上课课程"></asp:Label>
        </td>
    </tr>
    </table>
       <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
    <tr bgcolor="#E7E7E7" style="border-bottom:none">
	    <td align="left" colspan="6" background="../skin/images/tbg.gif">
            <table align="center" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="90px">
                        课程类型：</td>
                    <td width="210px">
                        <asp:DropDownList ID="ddlclassType" runat="server" Width="200px">
                        </asp:DropDownList>
                    </td>
                    <td width="100">
                        课程编号或名称： 
                    </td>
                    <td width="165">
                        <asp:TextBox ID="txtkey" runat="server" Width="150px"></asp:TextBox>
                    </td>
                   
                    <td width="100px">
                        <asp:ImageButton ID="ibtnsearch" runat="server" BorderStyle="None" 
                            Height="20px" ImageUrl="../skin/images/frame/search.gif" 
                            onclick="ibtnsearch_Click" Width="45px" />
                    </td>
                     
                </tr>
            </table>
        </td>
           <tr style="background-color:#ffffff">
               <td colspan="6">
                  <asp:GridView ID="GridView2" runat="server" AllowPaging="False" 
                       AllowSorting="true" AutoGenerateColumns="False" BorderColor="#D1DDAA" 
                       CellPadding="4" DataKeyNames="ClassId" DataMember="Name" GridLines="Both" 
                       OnRowDataBound="GridView2_RowDataBound" onsorting="GridView2_Sorting" 
                       PageIndex="1" SelectedIndex="0" Width="100%">
                       <Columns>
                           <asp:TemplateField HeaderText="选择">
                               <ItemTemplate>
                                   <asp:CheckBox ID="chkID" runat="server" />
                                   <asp:HiddenField ID="hdfClassId" runat="server" Value='<%#Eval("ClassId") %>' />
                               </ItemTemplate>
                               <ItemStyle HorizontalAlign="Center" width="40px" />
                           </asp:TemplateField>
                           <asp:TemplateField HeaderText="课程编号" SortExpression="Code">
                               <ItemTemplate>
                                   <asp:Label ID="lblCode" runat="server" Text='<%# Eval("Code") %>'></asp:Label>
                               </ItemTemplate>
                           </asp:TemplateField>
                           <asp:TemplateField HeaderText="课程类型" SortExpression="ClassTypeName">
                               <ItemTemplate>
                                   <asp:Label ID="lblTypename" runat="server" Text='<%# Eval("ClassTypeName") %>'></asp:Label>
                               </ItemTemplate>
                           </asp:TemplateField>
                           <asp:TemplateField HeaderText="课程名称" SortExpression="Name">
                               <ItemTemplate>
                                   <asp:Label ID="lblname" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                               </ItemTemplate>
                           </asp:TemplateField>
                           <asp:TemplateField HeaderText="课程小时数" SortExpression="Time">
                               <ItemTemplate>
                                   <asp:Label ID="lblTime" runat="server" Text='<%# Eval("Time") %>'></asp:Label>
                               </ItemTemplate>
                           </asp:TemplateField>
                           <asp:TemplateField HeaderText="是否启用">
                               <ItemTemplate>
                                   <asp:Label ID="lblIsValid" runat="server" Text='<%# Eval("IsValidDesc") %>'></asp:Label>
                               </ItemTemplate>
                           </asp:TemplateField>
                       </Columns>
                       <PagerSettings FirstPageText="" LastPageText="" NextPageText="" 
                           PreviousPageText="" />
                       <RowStyle BackColor="#FFFFFF" ForeColor="#000000" Height="20px" />
                       <FooterStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="White" />
                       <EditRowStyle BackColor="#FCFDEE" />
                       <SelectedRowStyle BackColor="#FFFFFF" ForeColor="#000000" />
                       <PagerStyle BackColor="#FCFDEE" ForeColor="White" HorizontalAlign="Center" />
                       <HeaderStyle BackColor="#FCFDEE" ForeColor="000000" />
                       <AlternatingRowStyle BackColor="#FCFDEE" ForeColor="#000000" />
                   </asp:GridView>
               </td>
           </tr>
           <tr bgcolor="#FAFAF1">
               <td height="28" style="padding-left:14px" class="style1">
                   <asp:CheckBox ID="selectAll" runat="server" AutoPostBack="true" Enabled="false" 
                       oncheckedchanged="selectAll_CheckedChanged" Text="全选" />
               </td>
                 <td width="70">
                        开始日期： 
                    </td>
                    <td width="165">
                        <asp:TextBox ID="txtstartdate" runat="server" onclick="fPopUpDlg('../../Scripts/calendar/calendar.htm', txtstartdate, 'winpop', 200, 210);return false" Width="150px"></asp:TextBox>
                    </td>
                      <td width="70">
                        结束日期： 
                    </td>
                    <td width="165">
                        <asp:TextBox ID="txtenddate" runat="server" onclick="fPopUpDlg('../../Scripts/calendar/calendar.htm', txtenddate, 'winpop', 200, 210);return false" Width="150px"></asp:TextBox>
                    </td>
                    <td><asp:Button ID="btnDeleteAdd" runat="server" class="coolbg" Enabled="false" 
                       OnClick="btnDeleteAdd_Click" OnClientClick="return checkForm();false"
                       Text="批量添加" /></td>
           </tr>
           <tr align="right" bgcolor="#EEF4EA">
               <td align="center" height="36" colspan="6">
                   <%--    <webdiyer:AspNetPager ID="pager1" runat="server" OnPageChanged="pager1_PageChanged"
                        PageSize="10">
                    </webdiyer:AspNetPager>--%>
               </td>
           </tr>
    </table>
    
     
    </ContentTemplate>
      <Triggers><asp:PostBackTrigger ControlID="btnexport" /></Triggers>
    </asp:UpdatePanel> 
    </form>
</body>
</html>
